package com.itetchologyandenglish.home.service.Impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.itetchologyandenglish.home.enetity.SysLog;
import com.itetchologyandenglish.home.mapper.SysMapper;
import com.itetchologyandenglish.home.service.SysLogDao;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service
public class SysLogImpl implements SysLogDao {
    @Resource
    SysMapper sysMapper;
    @Override
    public void saveSysLog(SysLog syslog) {
        if(syslog.getOperation()!=null &&!syslog.getOperation().equals("")) {
            sysMapper.saveSysLog(syslog);
        }
    }
    @Override
    public PageInfo getAllLogWith(String moduleName, String adminName, String searchbegin, String searchend, Integer page) {
        PageHelper.clearPage();
        PageHelper.startPage(page,10);
        List<SysLog> logList=sysMapper.getAllLogWith(moduleName,adminName,searchbegin,searchend);
        PageInfo  pageInfo=new PageInfo(logList);
        return pageInfo;
    }
}
